home *** CD-ROM | disk | FTP | other *** search
/ Aminet 47 / Aminet 47 (2002)(GTI - Schatztruhe)[Feb 2002].iso / Aminet / biz / haage / FreeSpaceDemo.lha / fsinst < prev    next >
Text File  |  2001-12-09  |  16KB  |  586 lines

  1. (set #minfree 50)
  2. (set #okfree 50)
  3. (set #goodfree 50)
  4. (set #inst1 "Freespace_1")
  5.  
  6. (set #ver (/ @installer-version 65536))
  7. (if (>= #ver 44)
  8.     (
  9.     (effect "lower_right" "radial" $C85037 $000000)
  10.     (showmedia "symbol" "FS_Installer.iff" "center" "none" 0)
  11.     )
  12. )
  13.  
  14. (if (< #ver 43)
  15.     (
  16.     (exit "Your Installer is too old. Get a new version from Aminet" (quiet))
  17.     )
  18. )
  19.  
  20. ; -- Locale strings - Deutsch --------------------------------
  21. (if (= @language "deutsch")
  22. (
  23.     (set #install-movies "Wollen Sie die Zwischensequenzen auf Festplatte installieren ?")    
  24.  
  25.     (set #choice-yes "\x1B[2pJa")
  26.     (set #choice-no  "Nein")
  27.  
  28.     (set #welcome-prompt (cat
  29.     "Willkommen zum Descent Freespace Demo Installations-Programm. Es wird Sie schrittweise "
  30.     "durch die Installation führen. Wenn Sie Probleme bekommen, können Sie durch "
  31.     "den Hilfe-Knopf weitere Informationen erhalten.\n"
  32.     "Bitte wählen Sie nun den Installations-Modus, abhängig von Ihrem "
  33.     "Kenntnisstand."
  34.     ))
  35.  
  36.     (set #dest-prompt (cat
  37.     "Wählen Sie die Festplatte oder das Verzeichnis aus, auf dem das Demo installiert "
  38.     "werden soll. Ein Verzeichnis mit dem Namen \"FreespaceDemo\" wird\n erzeugt. "
  39.     "Es sollten mindestens "
  40.     #minfree
  41.     " Megabytes für eine\n Installation frei sein. "
  42.         
  43.     ))
  44.  
  45.     (set #toolow (cat
  46.     "Die von Ihnen angewählte Festplatte hat nur noch %ld Megabytes \nfreien Speicher. "
  47.     "Für eine Installation sind mindestens " #minfree " Megabytes\n erforderlich. "
  48.     "Bitte wählen Sie eine andere Platte aus."
  49.     ))
  50.  
  51.     (set #extract-base "Basis-Dateien werden auf die Festplatte kopiert...")
  52.     (set #extract-bin "Programm-Dateien werden auf die Festplatte kopiert...")
  53.     (set #extract-aux "GUI- und Zusatzdateien werden auf die Festplatte kopiert...")
  54.     (set #extract-lang "Sprach-spezifische Daten werden auf die Festplatte kopiert...")    
  55.     (set #user-abort (cat
  56.     "Sie haben die Installation von Hand abgebrochen. Im jetzigen Zustand können "
  57.     "Sie das Descent Freespace Demo nicht nutzen. Um die Installations zu einem späteren Zeitpunkt "
  58.     "fortzusetzen, starten Sie das Installations-Programm erneut."
  59.     ))
  60.     (set #incomplete-install (cat
  61.     "Auf Ihrem System wurde eine unvollständig installierte Version des Descent Freespace Demo "
  62.     "gefunden. Diese sollte vor dem erneuten Installieren von der Festplatte entfernt werden."
  63.     "\n\nMöchten Sie dies nun tun?"
  64.     ))
  65.     (set #choice_1 "\x1B[2pInstallation so belassen (nicht empfohlen)")
  66.     (set #choice_2  "Unvollständige Installation löschen und neu starten")
  67.     (set #incomplete-help (cat
  68.     "Sie können das Löschen der alten, unvollständigen Installation überspringen und "
  69.     "die neuen Dateien über die alten kopieren lassen. \nDies ist allerdings nicht anzuraten, "
  70.     "da daß Ergebnis unvorhersehbar ist (einige Dateien könnten Schreib- oder Löschgeschützt sein).\n"
  71.     ))
  72.     (set #wipe-me "Bitte bestätigen Sie, daß Sie das Verzeichnis %s und seinen Inhalt löschen möchten")
  73.     (set #wipe-help "Wenn Sie mit \"Ja\" antworten, wird das komplette Verzeichnis samt Inhalt vernichtet.")
  74.     (set #uninstall-msg "Möchten Sie das Descent Freespace Demo von Ihrer Festplatte löschen?")
  75.     (set #keep-user (cat
  76.     "Da Ihre Spielstände in der Schublade \"Players\" im FreespaceDemo-Verzeichnis "
  77.     "gespeichert werden, können Sie dieses Verzeichnis für "
  78.     "später aufheben. "
  79.     "Möchten Sie ihre \"Players\"-Schublade behalten?"
  80.     ))
  81.     (set #uninstalled-full (cat
  82.     "Das Descent Freespace Demo wurde von Ihrer Festplatte entfernt. Um die neue Installation durchzuführen, "
  83.     "starten Sie das Installationsprogramm erneut."
  84.     ))
  85.     (set #uninstalled-nouser (cat
  86.     "Das Descent Freespace Demo wurde von Ihrer Festplatte entfernt. Ihre Spielstände "
  87.     "wurden nicht angetastet, und sind immer noch in %s zu finden."
  88.     ))
  89.     (set #finish-msg (cat
  90.     "Das Descent Freespace Demo wurde in der Schublade %s erfolgreich installiert\n"
  91.     "Bitte werfen Sie einen Blick auf die LIESMICH-Datei.\n Sollten Sie Warp3D V4.0\n"
  92.   "noch nicht installiert haben, empfehlen wir, es jetzt zu installieren."
  93.     ))
  94.     (set #see-readme "\x1B[2pEinen Blick auf die LIESMICH-Datei werfen")
  95.     (set #chunkyppc
  96.     "Kopiere die chunkyppc.library"
  97.     )
  98.     (set #fsound
  99.   "Kopiere die fsoundPPC.library"
  100.     )
  101.     (set #loading
  102.   "Kopiere das Ladebild"
  103.     )
  104.     (set #fsound68k
  105.   "Kopiere die fsound68k.library"
  106.     )
  107.     (set #wizard
  108.     "Kopiere wizard library"
  109.     )
  110.  ) 
  111. ; -- Locale strings - English --------------------------------
  112. (
  113.   (set #install-movies "Do you want to install the movies on your harddrive ?")
  114.  
  115.     (set #choice-yes "\x1B[2pYes")
  116.     (set #choice-no  "No")
  117.  
  118.     (set #welcome-prompt (cat
  119.     "Welcome to the Descent Freespace Demo installation program. This utility "
  120.     "will guide you through the installation in a step-by-step "
  121.     "process. At any time, "
  122.     "if you're stuck, you can press the help button to get more detailed "
  123.     "information. \n"
  124.     "Please indicate your level of expertise."
  125.     ))
  126.  
  127.     (set #dest-prompt (cat
  128.     "Select a directory where you want the demo to be installed. The "
  129.     "installation utility will create a directory named \"FreespaceDemo\" "
  130.     "in the directory you specify here.\n"
  131.     "Disk space requirements are "
  132.     #minfree
  133.     " MB for an installation. "
  134.     ))
  135.  
  136.     (set #toolow (cat
  137.     "The partition you selected only has %ld MB of free storage. For a minimal "
  138.     "installation you will require at least "
  139.     #minfree
  140.     " MB of free space. Please select another "
  141.     "place for the installation."
  142.     ))
  143.  
  144.     (set #extract-base "Copying base files to your harddisk...")
  145.     (set #extract-bin "Copying program files to your harddisk...")
  146.     (set #extract-aux "Copying GUI and support files to your harddisk...")
  147.     (set #extract-lang "Copying language-specific files to your harddisk...")    
  148.     (set #user-abort (cat
  149.     "You have manually aborted the installation. You will not be able "
  150.     "to run the Descent Freespace Demo in this state. To complete the installation at a "
  151.     "later time, re-run the installation program."
  152.     ))
  153.     (set #incomplete-install (cat
  154.     "An incomplete installation was discovered on your harddisk. It is highly recommended "
  155.     "that you wipe this from your drive before proceeding any further.\n\n"
  156.     "Do you want to delete the incomplete installation?"
  157.     ))
  158.     (set #choice_1 "\x1B[2pLeave as is and proceed (not recommended)")
  159.     (set #choice_2  "Wipe the incomplete installation and re-start")
  160.     (set #incomplete-help (cat
  161.     "You may choose not to uninstall this incomplete installation and just copy "
  162.     "the files over it. It is however not recommended to do this, as the result "
  163.     "might be unpredictable.\n"
  164.     ))
  165.     (set #wipe-me "Please confirm that you want to delete the directory %s and its contents")
  166.     (set #wipe-help "If you answer yes, the complete directory and contents will be deleted.")
  167.     (set #uninstall-msg "Do you want to uninstall the Descent Freespace Demo from your system?")
  168.     (set #keep-user (cat
  169.     "Since your savegames are stored in your \"Players\" directory, "
  170.     "you might want to keep this directory for later use. "
  171.     "Do you want to keep your \"Players\" directory?"
  172.     ))
  173.     (set #uninstalled-full (cat
  174.     "The Descent Freespace Demo has been uninstalled from your system. If you want to re-install it at "
  175.     "any later point, just run the installation utility again. "
  176.     ))
  177.     (set #uninstalled-nouser (cat
  178.     "The Descent Freespace Demo has been uninstalled from your system. Your savegames "
  179.     "have been left untouched, and can still be found in "
  180.     ))
  181.     (set #finish-msg (cat
  182.     "The Descent Freespace Demo can be found in the directory %s\n on your system"
  183.     "Please take a look at the README file. "
  184.     "If you have a 3D graphics card and you have not installed Warp3D 4.0 yet, "
  185.     "it is adviced that you do this now."
  186.     ))
  187.     (set #see-readme "\x1B[2pHave a look at the README-File")
  188.     (set #chunkyppc
  189.     "Copying chunkyppc.library"
  190.     )
  191.     (set #loading
  192.     "Copying Loading image"
  193.     )        
  194.     (set #wizard
  195.     "Copying wizard library"
  196.     )
  197.     (set #fsound
  198.   "Copying fsoundPPC.library"
  199.     )
  200.     (set #fsound68k
  201.   "Copying fsound68k.library"
  202.     )
  203.   ))
  204. ; -- Procedures ----------------------------------------------
  205.  
  206.   
  207. ; -- Procedures ----------------------------------------------
  208. (procedure P_AskDisk discnr
  209.     (if (= discnr 0)
  210.     (set #curvol #inst1)
  211.     (set #curvol #inst2)
  212.     )
  213.     (set #curvol (cat #curvol ":"))
  214. )
  215.  
  216. ; Try to find the amount of available memory
  217. ; Why isn't there a function for that? I don't need to know how much is
  218. ; free *now*, but I want to know how much is in this damn machine !!!
  219. (procedure P_GetTotalMem
  220.     (run "c/total >NIL:")
  221. )
  222.  
  223. ;    Verify the licence agreement
  224. (procedure P_DoLicence
  225.     (if (>= #ver 44)
  226.     (showmedia 'licence' 'LICENCE' 'upper_right' 'medium' 1 'wordwrap')
  227.     (run "sys:Utilities/Multiview LICENCE")
  228.     )
  229. )
  230.  
  231. ;    Set an environment variable (ENV: and ENVARC:)
  232. (procedure P_SetEnv variable value
  233.     (textfile
  234.     (help @textfile-help)
  235.     (dest (tackon "ENV:" variable))
  236.     (append value)
  237.     )
  238.     (textfile
  239.     (help @textfile-help)
  240.     (dest (tackon "ENVARC:" variable))
  241.     (append value)
  242.     )
  243. )
  244.  
  245. ;    Unset an environment variable
  246. (procedure P_UnsetEnv variable
  247.     (if (exists (tackon "ENV:" variable))
  248.     (delete (tackon "ENV:" variable)
  249.         (optional "force")
  250.     )
  251.     )
  252.  
  253.     (if (exists (tackon "ENVARC:" variable))
  254.     (delete (tackon "ENVARC:" variable)
  255.         (optional "force")
  256.     )
  257.     )
  258. )
  259.  
  260. ;    Check if the given path can hold enough data for the installation
  261. (procedure P_CheckSize path
  262.     (set #free 0)
  263.     (set #ok-movies 0)
  264.     (if (>= #ver 44)
  265.     (set #free (getdiskspace #dest-dir "M"))
  266.     (
  267.         (set #free (getdiskspace #dest-dir))
  268.         (set #free (/ #free 1048576))
  269.     )
  270.     )
  271.     (if (< (+ #free 0) (+ #minfree 0))
  272.     (
  273.         (set #message (#toolow #free))
  274.         (message #message)
  275.     )
  276.     )
  277.     (if (>= (+ #free 0) (+ #minfree 0))
  278.     (
  279.         (set #loop-flag 1)
  280.     )
  281.     )            
  282. )
  283.  
  284. (procedure P_UninstallIncomplete
  285.     (set #choice
  286.     (askchoice
  287.         (prompt #incomplete-install)
  288.         (help (cat #incomplete-help "\n" @askchoice-help))
  289.         (default 1)
  290.         (choices #choice_1 #choice_2)
  291.         
  292.     )
  293.     )
  294.     (if (= #choice 1)
  295.     (
  296.         (run (cat "delete >NIL: <nil: ALL FORCE \"" @default-dest "\"")
  297.         (prompt (#wipe-me @default-dest))
  298.         (confirm)
  299.         (help #wipe-help)
  300.         )
  301.         (P_UnsetEnv "Freespace/InstallationPathDemo")
  302.     )
  303.  
  304.     )
  305. )
  306.  
  307. (procedure P_DoUninstall
  308.     (set #flag
  309.     (askchoice
  310.         (prompt #keep-user)
  311.         (help @askchoice-help)
  312.         (choices #choice-yes #choice-no)
  313.         (default 1)
  314.     )
  315.     )
  316.     (set #delpattern @default-dest)
  317.     (if (= #flag 0)
  318.     (set #delpattern (tackon @default-dest "~(Players)"))
  319.     )
  320.     (run (cat "delete >NIL: <nil: ALL FORCE \"" #delpattern "\""))
  321.     (P_UnsetEnv "Freespace/InstallationPathDemo")
  322.     (if (= #flag 0)
  323.     (exit (#uninstalled-nouser (tackon @default-dest "Players") (pathonly @default-dest))
  324.         (quiet)
  325.     )
  326.     (exit #uninstalled-full (quiet))
  327.     )
  328. )
  329.  
  330. (procedure P_ProposeUninstall
  331.     (set #flag
  332.     (askchoice
  333.         (prompt #uninstall-msg)
  334.         (help @askchoice-help)
  335.         (choices #choice-yes #choice-no)
  336.         (default 1)
  337.     )
  338.     )
  339.     (if (= #flag 0) (P_DoUninstall))
  340.     (exit (quiet))
  341. )
  342.  
  343. (procedure P_DoRegister
  344.     (message #register-msg)
  345.     (set #cmdline (cat
  346.     "C/RegisterGUI \""
  347.     (tackon @default-dest "Freespace.exe")
  348.     "\""
  349.     ))
  350.     (set #retval
  351.     (run #cmdline
  352.     (help @run-help)
  353.     ))
  354.     (if (= #retval 10)
  355.     (exit "Internal Error during registering. Please contact tech suport" (quiet))
  356.     )
  357.     (if (= #retval 20)
  358.     (exit #user-abort (quiet))
  359.     )
  360. )
  361.  
  362. (procedure P_InstallData arg1 arg2
  363.     (set #cmdline
  364.     (cat
  365.         "C/makepakgui -u \""
  366.         (arg1)
  367.         "\" -a \""
  368.         arg2
  369.         "\""
  370.     )
  371.     )
  372. )
  373.  
  374. (procedure P_BuildCommandline arg1 arg2
  375.     (set #cmdline
  376.     (cat
  377.         "C/hUnpack -archive \""
  378.         (arg1)
  379.         "\" -dest \""
  380.         arg2
  381.         "\""
  382.     )
  383.     )
  384. )
  385.  
  386.  
  387. ; -- Start the installation process --------------------------
  388. (welcome #welcome-prompt)
  389. (P_AskDisk 0)
  390.  
  391. ; try to find an already present installation
  392. (complete 0)
  393. (set #flag (exists "ENV:Freespace/InstallationPathDemo"))
  394. (if (= #flag 1)
  395.     (
  396.     (set @default-dest (getenv "Freespace/InstallationPathDemo"))
  397.     (if (exists (tackon @default-dest "installer-cookie-demo"))
  398.         (P_UninstallIncomplete)
  399.         (P_ProposeUninstall)
  400.     )
  401.     (set @default-dest (pathonly @default-dest))
  402.     )
  403. )
  404.  
  405.  
  406. (P_DoLicence)
  407.  
  408. ; -- Ask for destination and create a directory if required --
  409. (set #loop-flag 0)
  410. (while (= #loop-flag 0)
  411.     (
  412.     (set #dest-dir
  413.         (askdir
  414.         (prompt #dest-prompt)
  415.         (default @default-dest)
  416.         (help @askdir-help)
  417.         )
  418.     )
  419.     (P_CheckSize #dest-dir) ; resets #loop-flag to 1 if size is ok
  420.     )
  421. )
  422.  
  423. (set #dest-dir (tackon #dest-dir "FreespaceDemo"))
  424. (set @default-dest #dest-dir) 
  425.  
  426.  
  427. (set #flag (exists @default-dest (noreq)))
  428.  
  429. (if (= #flag 0)
  430.     (
  431.     (makedir @default-dest)
  432.     )
  433. )
  434.  
  435. ; Since we have the installation directory now, we add a small file there
  436. ; This will be used to find out if the installation was successful
  437. (textfile
  438.     (dest (tackon @default-dest "installer-cookie-demo"))
  439.     (append "I am a cookie. Bite me")
  440. )
  441.  
  442. (complete 20)
  443. ; Create base/ if not already present
  444. (set #base-dir (tackon @default-dest "data"))
  445. (set #flag (exists #base-dir (noreq)))
  446. (if (= #flag 0)
  447.     (
  448.     (makedir #base-dir (infos))
  449.     )
  450. )
  451.  
  452. ; -- Set a variable to indicate where we are installing ------
  453. ;    Will be used when the installer is launched a second time
  454.  
  455. (set #flag (exists "ENV:Freespace" (noreq)))
  456. (if (= #flag 0)
  457.     (
  458.     (makedir "ENV:Freespace")
  459.     (makedir "ENVARC:Freespace")
  460.     )
  461. )
  462. (P_SetEnv "Freespace/InstallationPathDemo" @default-dest)
  463.  
  464. (complete 30)
  465.  
  466. ; -- Ready to start installation -----------------------------
  467. (copylib
  468.     (prompt #chunkyppc)
  469.     (help @copylib-help)
  470.     (source ("libs/chunkyppc.library"))
  471.     (dest #dest-dir)
  472. )
  473.  
  474. (complete 35)
  475.  
  476. (copylib
  477.     (prompt #wizard)
  478.     (help @copylib-help)
  479.     (source ("libs/wizard.library"))
  480.     (dest #dest-dir)
  481. )
  482.  
  483. (complete 40)
  484.  
  485. (copyfiles(source "loading_wait.pcx")(help "")(dest #dest-dir))
  486. (copyfiles(source "Freespace.prefs")(help "")(dest #dest-dir))
  487.  
  488. (complete 45)
  489.  
  490. (copylib
  491.         (prompt #fsound)
  492.     (help @copylib-help)
  493.     (source ("libs/fsoundPPC.library"))
  494.     (dest #dest-dir)
  495. )
  496.  
  497. (copylib
  498.         (prompt #fsound68k)
  499.     (help @copylib-help)
  500.     (source ("libs/fsound68k.library"))
  501.     (dest #dest-dir)
  502. )
  503.  
  504. ; unpack data
  505. (P_BuildCommandLine "data_demo.hpa" (tackon @default-dest "data"))
  506. (working #extract-base)
  507. (set #status
  508.     (run #cmdline
  509.     (help @run-help)
  510.     )
  511. )
  512.  
  513. (if (= #status 2)
  514.     (
  515.     (exit #user-abort (quiet))
  516.     )
  517. )
  518.  
  519. (P_BuildCommandLine "gui.hpa" @default-dest)
  520. (working #extract-aux)
  521. (set #status
  522.     (run #cmdline
  523.         (help @run-help)
  524.     )
  525. )
  526.  
  527. (set #flag (exists "libs:powerpc.library" (noreq)))
  528.  
  529. (if (= #flag 0)
  530. (
  531. ; unpack BIN
  532. (P_BuildCommandLine "bin.hpa" @default-dest)
  533. (working #extract-bin)
  534. (set #status
  535.     (run #cmdline
  536.     (help @run-help)
  537.     )
  538. )
  539.  
  540. (if (= #status 2)
  541.     (
  542.     (exit #user-abort (quiet))
  543.     )
  544. )
  545. )
  546. )
  547.  
  548. (if (= #flag 1)
  549. (
  550. ; unpack BIN
  551. (P_BuildCommandLine "binPPC.hpa" @default-dest)
  552. (working #extract-bin)
  553. (set #status
  554.     (run #cmdline
  555.     (help @run-help)
  556.     )
  557. )
  558.  
  559. (if (= #status 2)
  560.     (
  561.     (exit #user-abort (quiet))
  562.     )
  563. )
  564. )
  565. )
  566.  
  567. ; Register your copy
  568. (complete 100)
  569. ; Finish by wiping the installer-cookie
  570. (delete (tackon @default-dest "installer-cookie-demo"))
  571. (set #opts
  572.     (askoptions
  573.     (help @askoptions-help)
  574.     (prompt (#finish-msg @default-dest))
  575.     (choices #see-readme)
  576.     (default 1)
  577.     )
  578. )
  579.  
  580. (if (IN #opts 0)
  581.     (if (>= #ver 44)
  582.     (showmedia "readme.txt" "README.TXT" "upper_right" "medium" 1)
  583.     (run "sys:Utilities/Multiview README.TXT")
  584.     )
  585. )
  586.